//
//  MailBoxItemModel.m
//  Utils
//
//  Created by enghou on 2018/4/12.
//  Copyright © 2018年 xyxorigation. All rights reserved.
//

#import "MailBoxItemModel.h"
#import "NSString+size.h"
@implementation MailBoxItemModel
-(instancetype)initWithSource:(NSDictionary *)source{
    self = [super initWithSource:source];
    if (self) {
        self.title = [self contentForKey:@"title" withSource:source];
        self.time = [self contentForKey:@"sendDate" withSource:source];
        self.user_name = [self contentForKey:@"sender" withSource:source];
        self.detail = [self contentForKey:@"content" withSource:source];
        BOOL read = [[source objectForKey:@"readState"]boolValue];
        self.readyet = read;
        self.ids = [self contentForKey:@"id" withSource:source];
        //48
        self.height = 70 + [self.detail caculateSizeWithFont:[UIFont systemFontOfSize:14] MaxSize:CGSizeMake(ScreenWidth - 32, 80)].height;
    }
    return self;
}
@end
